//
//  OcrView.h
//  ocr_plugin
//
//  Created by apple on 2021/9/15.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

//定义回调接口
typedef void (^OcrViewSuccessBlock)(NSDictionary* dict);
typedef void (^OcrViewFailurelock)(NSString* code,NSString* message);

@interface OcrView : UIView

/// 初始化
- (instancetype)initWithFrame:(CGRect)frame args:(NSDictionary *)args captureSessionQueue:(dispatch_queue_t)captureSessionQueue;

//识别结果信息回调
- (void)achieveResult:(OcrViewSuccessBlock)block;
- (void)achieveError:(OcrViewFailurelock)block;

- (void)configAreaFrame:(CGRect)areaFrame faceFrame:(CGRect)faceFrame;

///设置识别后图片、头像图片的保存路径
-(void)setOcrFilePath:(NSString*)imgPath headPath:(NSString*)headPath;
///摄像头暂停
-(void)pause;
///摄像头重启
-(void)resume;
///摄像头关闭，释放数据
-(void)close;
//-(void)toogleFlash:(BOOL)closeFlash;

#pragma mark - 点击相册
- (void)takePhotoLibrary;

#pragma mark - 点击拍照
- (void)takePhotoCamera;
/// 拍照裁剪
- (void)takePhotoCameraWithRect;

#pragma mark - 切换摄像头
- (void)switchCamera;

///更新参数
- (void)updateParams:(NSDictionary *)args;

@end

NS_ASSUME_NONNULL_END
